<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="bean.Donate"%>
<%@page import="bean.Funding_information"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
	<head>
		<title></title>
		<link rel="shortcut icon" href="images/titleico.ico" />
		<link href="css/myA.css" type="text/css" rel="stylesheet">
		<link href="css/myCss.css" type="text/css" rel="stylesheet"/>
	</head>
	<body>
		<%
			ArrayList<Donate> donate_list = (ArrayList<Donate>) session
					.getAttribute("donate_list");
			ArrayList<Funding_information> funding_information_list = (ArrayList<Funding_information>) session
					.getAttribute("funding_information_list");
			if (donate_list == null) {
				response.sendRedirect("donate?page=news_d.jsp");
			} else if (funding_information_list == null) {
				response.sendRedirect("funding_information?page=news_d.jsp");
			}
		%>
		<jsp:include page="top.jsp"></jsp:include>
		<table align="center" cellpadding="0" cellspacing="0" width="960">
			<tr>
				<td valign="top">
					<jsp:include page="leftshow.jsp"></jsp:include>
				</td>
				<td valign="top">
					<table cellspacing="0" cellpadding="0" align="right" width="630">
						<tr>
							<td>
								<hr width="630" color="#CC9966" align="right" />
							</td>
						</tr>
						<tr>
							<td style="padding-left: 20">
								<img src="images/n_zzxx.jpg" />
							</td>
						</tr>

						<tr>
							<td>
								<hr width="630" color="#CC9966" align="right" />
							</td>
						</tr>

						<tr>
							<td>
								<table cellpadding="6" cellspacing="0" width="630"
									align="center">
									<c:forEach items="${separate_funding_information_list}"
										var="funding_information">
										<tr style="font-size: 10">
											<td>
												<a href="newsshow_d.jsp?id=${funding_information.id }" class="style1">·${funding_information.donate_title}</a>
											</td>
											<td align="center">
												[${funding_information.funding_information_date}]
											</td>
										</tr>
									</c:forEach>
								</table>
							</td>
						</tr>
						<tr>
							<td class='' align="center" style="padding-top: 30;padding-left: 250">
								<div>
									共有<b>${funding_information_total_items}</b>条记录 当前第<b>${funding_information_current_page}</b>/<b>${funding_information_total_pages}</b>页
									<input type="text" name="inputIndex" id="inputIndex" size="2" />
									<a href="javascript:;" class="style1" id="forward1"
										onclick="check('${funding_information_total_pages}')">跳转</a>
									<c:if test="${funding_information_current_page!=1}">
										<a href="separateFunding_information?page=news_d.jsp&index=1"
											class="style1">上一页</a>
									</c:if>
									<c:if test="${funding_information_current_page!=funding_information_total_pages}">
										<a href="separateFunding_information?page=news_d.jsp&index=2"
											class="style1">下一页</a>
									</c:if>

								</div>
							</td>
						</tr>
					</table>

				</td>
			</tr>

		</table>
		<jsp:include page="bottom.jsp"></jsp:include>
		<script type="text/javascript">
			function check(funding_information_total_pages) {
				var input = document.getElementById("inputIndex").value;
				var regex = /^[1-9][0-9]*$/;
				if (input == "" ) {
					alert("输入的数字不能为空!");
				} else if (!regex.test(input)) {
					alert("输入的数字不符合要求!");
				}else if (input > funding_information_total_pages) {
					alert("输入的数字超过最大页数!");
				}else {
					document.getElementById("forward1").href = "separateFunding_information?page=news_d.jsp&index=3&indexpagefunding_information="
							+ input;
				}
			}
		</script>
		
		<%
			if(donate_list != null && funding_information_list != null ) {
				session.removeAttribute("donate_list");
				session.removeAttribute("funding_information_list");
			}
		%>
	</body>
</html>